package com.rc.evcharger.common.terminal;


/**
 * 解锁
 * Create by Yang on 2019/1/30
 */
public class UnLockResult implements Result {

    private String gunNum; // 1.枪号

    private String lockStatus;  //解锁状态码

    private String fault;   //失败原因

    private String obligate; // 预留字段;


    public String getGunNum() {
        return gunNum;
    }

    public void setGunNum(String gunNum) {
        this.gunNum = gunNum;
    }

    public String getLockStatus() {
        return lockStatus;
    }

    public void setLockStatus(String lockStatus) {
        this.lockStatus = lockStatus;
    }

    public String getFault() {
        return fault;
    }

    public void setFault(String fault) {
        this.fault = fault;
    }

    public String getObligate() {
        return obligate;
    }

    public void setObligate(String obligate) {
        this.obligate = obligate;
    }

    @Override
    public UnLockResult getResult(String dataStr) {
        dataStr = dataStr.trim();
        this.gunNum = dataStr.substring(0, 2);
        dataStr = dataStr.substring(3);
        this.lockStatus = dataStr.substring(0, 2);
        dataStr = dataStr.substring(3);
        this.fault = dataStr.substring(0, 2);
        dataStr = dataStr.substring(3);
        this.obligate = dataStr.trim();
        return this;
    }
}
